<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Cache-control" content="max-age=0" />
		<meta http-equiv="Expires" content="0" />
		<meta http-equiv="Pragma" content="no-cache" />
		<script type="text/javascript" src="easyui/jquery.min.js"></script>
		<script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js" ></script>
		<link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css"/>
		<link rel="stylesheet" type="text/css" href="easyui/themes/icon.css" />
		<link rel="stylesheet" type="text/css" href="easyui/demo/demo.css"/>
		<link rel="stylesheet" type="text/css" href="easyui/themes/color.css" />
		<title>登记案件</title>
		<script type="text/javascript">
		$(function(){
			//初始化 ready
			$('#student').hide();
			$('#teacher').hide();
			$('#reporterInfo').hide();
		});
		</script>
	</head>
	<body>
		<div id="buttonArea">
			<table width="98%" border="0" cellpadding="0" cellspacing="0" class="CContent">
				<tr >
					<th class="tablestyle_title" align="left"><img src="images/icon_1.png" height="28" width="45"/>添加事件</th>
				</tr>
				<tr>
					<td style="background-color:#ccc;line-height:20px;" id="tool">
					<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="saveEvent()">保存事件</a>
					<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" plain="true" onclick="sendEmail()">发送邮件给报案人</a>
					<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" plain="true" onclick="sendSMS()">发送短信给负责人</a>
					<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" plain="true" onclick="uploadAudio()">上传录音</a>
					<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" plain="true" onclick="uploadImage()">上传图片</a>
					<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" plain="true" onclick="printEvent()">打印</a></td>
				</tr>
				<tr>
					<td>
					<fieldset style="height:98%;" >
						<legend>
							上传录音
						</legend>
						<div id="audioBox"></div>
						<form action="" id="audioForm" enctype="multipart/form-data" method="post">
							<input type="file" name="file" id="audioFile"/>
							<span id="uploadAudioLoading"></span>
							<input type="hidden" id="eventId2" name="eventId" value="" />
						</form>
					</fieldset></td>
					<td>
					<fieldset style="height:98%;">
						<legend>
							上传图片
						</legend>
						<div id="imageBox"></div>
						<form action="" id="imageForm" enctype="multipart/form-data" method="post">
							<input type="file" name="file" id="imageFile"/>
							<span id="uploadImageLoading"></span>
							<input type="hidden" id="eventId3" name="eventId" value="" />
						</form>
					</fieldset></td>
				</tr>
			</table>
		</div><!--end of button Area !-->
		<div id="reporter">
			<fieldset>
				<legend>报案人基本信息</legend>
				<table width="50%">
					<tr>
						<td width="20%"><span>与当事人关系</span></td>
						<td width="80%">
							<select id="relation" class="easyui-combobox" style="width:36%">
								<option>请选择---</option>
								<option value="0">本人</option>
								<option value="1">同学</option>
								<option value="2">亲属</option>
								<option value="3">同事</option>
								<option value="4">朋友</option>
								<option value="5">其它</option>
							</select>
						</td>
					</tr>
				</table>
				<div id="reporterInfo">
					<table width="100%">
						<tr>
							<td width="10%">报案人姓名</td>
							<td width="15%">
								<input class="easyui-textbox" required="true" style="width: 98%"/>
							</td>
							<td width="10%">报案人电话</td>
							<td width="15%">
								<input class="easyui-textbox" required="true" style="width:98%"/>
							</td>
							<td width="10%">报案人单位</td>
							<td width="15%">
								<input class="easyui-textbox" width="98%"/></td>
							<td width="10%">报案人住址</td>
							<td width="15%">
								<input class="easyui-textbox" style="width:98%"/>
							</td>
						</tr>
					</table>
				</div>
			</fieldset>
		</div><!--end of div reporter!-->
		<div id="victim">
			<fieldset>
				<legend>
					当事人基本信息
				</legend>
				<table width="50%">
					<tr>
						<td width="20%"><span>当事人类型</span></td>
						<td width="80%">
						<select id="victimType" class="easyui-combobox" style="width:36%">
							<option>请选择---</option>
							<option value="0">学生</option>
							<option value="1">教职工</option>
						</select></td>
					</tr>
				</table>
				<div id="student">
					<form id="studentInfo">
						<table>
							<tr>
								<td width="10%"><span>年级</span></td>
								<td width="15%">
								<select id="grade" class="easyui-combobox" style="width:98%">
									<option value="11">11</option>
									<option value="12">12</option>
									<option value="13">13</option>
									<option value="14">14</option>
									<option value="15">15</option>
									<option value="16">16</option>
								</select></td>
								<td width="10%"><span>院系</span></td>
								<td width="15%">
									<input class="easyui-combobox" id="stud_academy" style="width:98%"
												data-options="url: 'Resource_departmentList',
															  method: 'get',
															  valueField: 'DEPARTMENTNAME',
															  textField: 'DEPARTMENTNAME',
															  panelWidth: 100,
															  panelHeight: 'auto'" />
								</td>
								<td width="10%"><span>专业</span></td>
								<td width="15%">
									<input class="easyui-combobox" id="stud_major" name="stud_major"
									       style="width:98%" data-options="valueField:'MAJOR',textField:'MAJOR'"
									      />
								</td>
								<td width="10%"><span>班级</span></td>
								<td width="15%">
									<input class="easyui-combobox" id="className" name="className"
									       style="width:98%" data-options="valueField:'CLASSNAME',textField:'CLASSNAME'"
									      />
								</td>
							</tr><!--end of tr 1!-->
							<tr>
								<td width="10%">性别</td>
								<td>
									<select class="easyui-combobox" id="gender" style="width:98%">
										<option value="男">男</option>
										<option value="女">女</option>
									</select>
								</td>
								<td width="10%">姓名</td>
								<td width="15%">
									<input class="easyui-combobox" id="stud_name" style="width:98%" 
									       data-options="valueField:'STUDENTNAME',textField:'STUDENTNAME'"
									       />
					
								</td>
								<td width="10%">学号</td>
								<td width="15%">
									<input class="easyui-combobox" id="stud_id" style="width:98%" 
									       data-options="valueField:'STUDENTID',textField:'STUDENTID'"
									       />
					
								</td>
								<!--
								<td width="10%"><span>宿舍号</span></td>
								<td width="15%">
									<input class="easyui-combobox" id="stud_room" style="width:98%" 
									       data-options="valueField:'STUDENTROOM',textField:'STUDENTROOM'"
									       />
								</td>
								!-->
							</tr>
							<tr>
								<td width="10%"><span>报案人电话</span></td>
								<td width="15%">
									<input class="easyui-textbox" required="true" style="width:98%"/>
								</td>
								<td width="10%"><span>联系人电话</span></td>
								<td width="15%">
									<input class="easyui-textbox" required="true" style="width:98%"/>
								</td>
								<td width="10%"><span>辅导员</span></td>
								<td width="15%">
									<input class="easyui-textbox" required="true" readonly="true" style="width:98%"/>
								</td>
								<td width="10%"><span>辅导员电话</span></td>
								<td width="15%">
									<input class="easyui-textbox" required="true" readonly="true" style="width:98%"/>
								</td>
							</tr>
							<tr>
								<td width="10%"><span>班主任</span></td>
								<td width="15%">
									<input class="easyui-textbox" required="true" readonly="true" style="width:98%"/>
								</td>
							</tr>
						</table>
					</form>
				</div><!--end of student !-->
				<div id="teacher">
					<form id="teacherInfo">
						<table width="100%">
							<tr>
								<td width="10%" style="padding:0,5px"><span>工作单位</span></td>
								<td width="15%" style="padding:0,5px">
									<select id="teac_academy" class="easyui-combobox" style="width:98%">
										<option value="工程技术学院">工程技术学院</option>
										<option value="外国语学院">外国语学院</option>
									</select>
								</td>
								<td width="10%" style="padding:0,5px"><span>部门领导</span></td>
								<td width="15%" style="padding:0,5px">
									<select id="academy_leader" class="easyui-combobox" style="width:98%">
										<option value="徐政权">徐政权</option>
										<option value="曾凤生">曾凤生</option>
										<option value="孙长圣">孙长圣</option>
										<option value="刘明真">刘明真</option>
									</select>
								</td>
								<td width="10%"><span>领导电话</span></td>
								<td width="15%">
									<input class="easyui-textbox" required="true" />	
								</td>
								<td width="10%"><span>报案人电话</span></td>
								<td width="15%">
									<input class="easyui-textbox" required="true"  style="width: 98%"/>
								</td>
							</tr><!--end of tr 1!-->
							<tr>
								<td><span>联系人电话</span></td>
								<td>
									<input class="easyui-textbox" required="true" />
								</td>
								<td width="10%" style="padding:0,5px"><span>宿舍号</span></td>
								<td width="15%" style="padding:0,5px">
									<select id="teac_room" class="easyui-combobox" style="width:98%">
										<option value="-1">不详</option>
										<option value="黄海-106">黄海-106</option>
										<option value="青海-107">青海-107</option>
										<option value="北海-108">北海-108</option>
									</select>
								</td>
							</tr>
						</table>
					</form>
				</div><!--end of div teacher!-->
			</fieldset>
		</div><!--end of div victim !-->
		<div id="event" width="100%">
			<fieldset>
				<legend>案件基本信息</legend>
				<form id="eventInfo">
					<table "width=100%">
						<tr>
							<td width="10%">案件类型</td>
							<td width="15%">
								<select class="easyui-combobox" id="eventType" style="width:98%">
									<option value="0">警情类</option>
									<option value="1">医疗类</option>
									<option value="2">后勤类</option>
									<option value="3">领导交办类</option>
									<option value="4">学生事务</option>
									<option value="5">其它类</option>
								</select>
							</td>
							<td width="5%">主管部门</td>
							<td width="15%">
								<select class="easyui-combobox" id="adminDepartment" style="width:98%">
									<option value="0">治安处</option>
									<option value="1">后勤部</option>
									<option value="2">学生事务部</option>
									<option value="3">医务所</option>
									<option value="4">教务部</option>
								</select>
							</td>
							<td width="10%" >主管领导电话</td>
							<td width="15%" >
								<input class="easyui-textbox" readonly="true" style="width:98%"/>
							</td>
							<td width="10%" >协助部门</td>
							<td width="15%" >
								<select class="easyui-combobox" id="cooperateDepartment" style="width:98%">
									<option value="0">治安处</option>
									<option value="1">后勤部</option>
									<option value="2">学生事务部</option>
									<option value="3">医务所</option>
									<option value="4">教务部</option>
								</select>
							</td>
						</tr>
						<tr>
							<td width="10%">協管领导电话</td>
							<td width="15%">
								<input class="easyui-textbox" readonly="true" style="width:98%"/>
							</td>
							<td width="10%">具体经办人</td>
							<td width="15%">
								<select class="easyui-combobox" id="executor" style="width:98%">
									<option value="0">张山</option>
									<option value="1">李德</option>
								</select>
							</td>
							<td width="10%" >经办人电话</td>
							<td width="15%" >
								<input class="easyui-textbox" style="width:98%"/>
							</td>
						</tr>
						<tr>
							<td width="10%"><span>处理方式</span></td>
							<td width="15%"><input type="checkbox" />短信通知</td>
							<td width="15%"><input type="checkbox" />电话通知</td>
						</tr>
						<tr>
							<td width="10">通知对象</td>
							<td width="10%" align="bottom"><input type="checkbox" />具体经办人</td>
							<td width="10%"><input type="checkbox" />主管领导</td>
							<td width="10%"><input type="checkbox" />协管领导</td>
							<td width="10%"><input type="checkbox" />辅导员</td>
							<td width="*">
								其它人员<input class="easyui-textbox" data-options="prompt:'请输入电话'"/>								
							</td>
						</tr>
						<tr>
							<td>案件描述</td>
						</tr>
					</table>
					<table width="80%" align="center">
						<tr>
					    	<td nowrap align="center">
					    	<textarea name="eventContent" id="mainContent" cols="100" rows="15" style="background: url('images/icon_1.png') no-repeat bottom right;resize:none;"class="easyui-validatebox" required="true" missingMessage="请输入内容" placeholder="请输入事件内容"></textarea>
					    	</td>
						</tr>
					</table>
				</form>
			</fieldset>
		</div><!--end of div event!-->
	</body>
	<script type="text/javascript">
		$("#relation").combobox({
			onChange : function() {
				var value = $(this).combobox('getValue');
				alert(value);
				if (value == 0 || value == '请选择---') {
					$("#reporterInfo").hide();
				} else {
					$("#reporterInfo").show();
				}
			}
		});

		$("#victimType").combobox({
			onChange : function() {
				var value = $(this).combobox('getValue');
				alert(value);
				if (value == 0) {
					$("#student").show();
					$("#teacher").hide();
				} else if (value == '请选择---') {
					$("#student").hide();
					$("#teacher").hide();
				} else {
					$("#teacher").show();
					$("#student").hide();
				}
			}
		});
		
		$("#stud_academy").combobox({
			onSelect: function(){
				var stud_academy = $(this).combobox('getValue');
				$("#stud_major").combobox('reload','Resource_majorList?stud_academy='+stud_academy);
			}
		});
		
<!--		$("#stud_major").combobox({
			onSelect:function(){
				var major = $(this).combobox('getValue');
				var grade = $("#grade").combobox('getValue');
				$("#className").combobox('reload','Resource_classNameList?grade=' 
						+ grade +'&major=' + major);
			}
		})；
		
		$("#gender").combobox({
			onSelect:function(){
				var className = $("#className").combobox('getValue');
				var gender = $("#this").combobox('getValue');
				alert(className);
				alert(gender);
				$("#stud_name").combobox('reload','Resource_studentNameList?className=' 
						+ className +'&gender=' + gender);
			}
		})；
		
		$("#stud_name").combobox({
			onSelect:function(){
				var className = $("#className").combobox('getValue');
				var stud_name = $("#this").combobox('getValue');
				alert(className);
				alert(stud_name);
				$("#stud_id").combobox('reload','Resource_studentIdList?className=' 
						+ className +'&stud_name=' + stud_name);
			}
		})；
!-->		
	</script>
</html>